
<!-- target:list -->
<form name="billListForm" action="javascript: void(0);" class="flex-page">
    <div ui="type:mao.ui.SearchText;listView:bill-list-view">
        <input type="search" name="searchContent" value="" autocomplete="off" placeholder="搜索">
        <span class="ui-search-close">取消</span>
    </div>

    <ul ui="type:mao.ui.AppListView;id:bill-list-view;view:bill.billList;initRefresh;reqUrl:/erp-management/application/list?billListForm;customEmpty:true;" class="page-cont bill-select-items">
        <!-- use:list-empty -->
    </ul>
</form>
<!-- 申请单选择列表项 -->
<!-- target:billListItem -->
<li>
    <!-- var:href = ['', 'bill.purchase.detail', 'bill.cost.detail', 'bill.loan.detail', 'bill.reimbursement.detail', 'bill.corporatePayment.detail'][${item.invoiceType}] -->
    <div ui="ext-link;" href="#/finance/${href}~id=${item.id}~DENY_CACHE" class="apply-item bill-select-item">
        <div class="name">
            <span class="ui-tag ui-tag-mini">${item.invoiceType|parseBaseInfo('finInvoiceType')}</span>
            <span>${item.reasons|default}</span>
            <span class="fr">￥${item.applyAmount}</span>
        </div>
        <div class="item-cont">
            <span class="day">${item.ctime|dateFormat('yyyy-MM-dd')}</span>
            <span class="fr primary-text">${item.invoiceStatusDesc}</span>
        </div>
    </div>
</li>

<!-- 单据详情页 - 页头 -->
<!-- target:detailHeader -->
<div class="detail-title">
    <div class="title-text">${detail.applyPersonName|default} 提交的 ${detail.invoiceType|parseBaseInfo('finInvoiceType')}</div>
    <!-- if:${detail.invoiceStatus} == 1 -->
    <div class="title-tip">等待 ${detail.approval.currentApproverName} 处理</div>
    <!-- else -->
    <div class="title-tip">${detail.invoiceStatus|parseBaseInfo('finInvoiceStatus')}</div>
    <!-- /if -->
</div>

<!-- 对公支付、普通报销 - 费用明细选择页面 -->
<!-- target:applyCostSelect -->
<div class="search-cont-page flex-page">
    <form ui="type:mao.ui.SearchText;" name="applyCostSearchForm">
        <input type="text" value="" name="searchContent" autocomplete="off" placeholder="搜索">
    </form>
    <input name="isRelevanceInvoice" ui="type:text;" value="0" class="ui-hide" />
    <ul ui="type:mao.ui.AppListView;id:apply-cost-list-view;view:bill.applyCostSelectList;initRefresh;reqUrl:/erp-management/cost/list?applyCostSearchForm&isRelevanceInvoice=0&isMine=1;customEmpty:true;" class="flex-cont cost-items grey-bg">
        <!-- use:list-empty -->
    </ul>
    <div class="bottom-btn-box">
        <div ui="type:mao.ui.MutilSelectSaveBtn" class="ui-button ui-button-primary ui-button-full">确定</div>
    </div>
</div>
<!-- 对公支付、普通报销 - 费用明细选择列表项 -->
<!-- target:applyCostSelectListItem -->
<li>
    <div ui="type:mao.ui.SelectCheckbox;item:&{item};value:${item.id};" class="cost-item white-bg cost-${item.costType}">
        <div class="cost-info">
            <span class="icon"></span>
            <span class="name">${item.costType|parseBaseInfo('finCostType')}</span>
            <span class="money fr">￥${item.costAmount}</span>
            <div class="time">${item.costTime|dateFormat('yyyy-MM-dd')}</div>
        </div>
        <div class="cost-cont">
            <div class="cost-city">消费城市：${item.costCityId|parseRegion}</div>
        </div>
    </div>
</li>

<!-- target:costItems -->
<!-- var:item = ${item|parseRadioItem} || [] -->
<!-- for:${item} as ${_item} -->
    <!-- use:bill.costItem(item=${_item},name=${name},num=${num}) -->
<!-- /for -->

<!-- 对公支付、普通报销 - 费用明细项 -->
<!-- target:costItem -->
<div class="cost-item" ui="type:control;item:&{item}">
    <!-- if:!${isDetail} -->
    <input class="ui-hide" name="${name}" ui="type:ecui.esr.CreateObject" />
    <!-- for:${item} as ${_item},${_index} -->
    <input class="ui-hide" name="${name}.${_index}" value="${_item}"/>
    <!-- /for -->
    <!-- /if -->

    <div class="info-title">
        <span>申请明细={${i} + 1 ? ${i} + 1 : 0}</span>
        <!-- if:!${isDetail} -->
        <a class="fr" ui="type:NS.AddCostBtn;ext-calculate-cost:${num};isCopy;route:/finance/book.edit~copyId=${item.id}~isCopy=true~fromEdit=true;regexp:.{0};text:复制"></a>
        <a class="fr danger-text" ui="ext-deleteItem;id:${item.id};ext-calculate-cost:${num};item:&{item}">删除</a>
        <!-- /if -->
    </div>
    <div class="info-item">
        <div class="info-label">类型</div>
        <div class="info-text">${item.costType|parseBaseInfo('finCostType')}</div>
    </div>
    <div class="info-item">
        <div class="info-label">金额</div>
        <div class="info-text">￥${item.costAmount|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">日期</div>
        <div class="info-text">${item.costTime|dateFormat('yyyy-MM-dd')}</div>
    </div>
    <div class="info-item">
        <div class="info-label">消费城市</div>
        <div class="info-text">${item.costCityId|parseRegion}</div>
    </div>
</div>


<!-- 厂牌项目选择页面 -->
<!-- target:brandProjectSelect -->
<div class="search-cont-page flex-page white-bg">
    <form ui="type:mao.ui.SearchText;" name="brandProjectSearchForm">
        <input type="text" value="" name="searchContent" autocomplete="off" placeholder="搜索">
    </form>
    <ul ui="type:mao.ui.AppListView;id:apply-cost-list-view;view:bill.brandProjectSelectList;initRefresh;reqUrl:/erp-management/label-project/list?brandProjectSearchForm&projectStatus=3;customEmpty:true;" class="bill-select-items flex-cont grey-bg">
        <!-- use:list-empty -->
    </ul>
</div>
<!-- 厂牌项目选择列表项 -->
<!-- target:brandProjectSelectListItem -->
<li>
    <div ui="type:mao.ui.SelectRadio;item:&{item};value:${item.id};" class="apply-item bill-select-item white-bg radius-16">
        <div class="apply-title">${item.creatorName} 提交的 立项申请</div>
        <div class="apply-info">项目名称：${item.projectName|default}</div>
        <div class="apply-info">演出时间：${item.showStartTime|dateFormat('yyyy-MM-dd')}</div>
        <div class="apply-info">场馆：${item.labelProjectVenue.venueName|default}</div>
        <div class="apply-tip">
            <span class="info-text">${item.ctime|dateFormat('yyyy-MM-dd')} 来自 审批</span>
        </div>
    </div>
</li>
<!-- 厂牌项目选中项 -->
<!-- target:brandProjectSelectFormItem -->
<div class="apply-item apply-info-item" ui="type:control;item:&{item};ext-link;ext-stopPropagation" href="#/brand/project.detail~id=${item.id}~DENY_CACHE">
    <div class="apply-info-title">${item.creatorName} 提交的 立项申请</div>
    <div class="apply-info-text">项目名称：${item.projectName|default}</div>
    <div class="apply-info-text">项目编号：${item.projectCode}</div>
    <div class="apply-info-text">使用时间：${item.showStartTime|dateFormat('yyyy-MM-dd')}</div>
    <div class="apply-info-text">演出场馆：${item.labelProjectVenue.venueName|default}</div>

</div>

<!-- 申请单选择页面 -->
<!-- target:applySelect -->
<div class="search-cont-page flex-page white-bg">
    <form ui="type:mao.ui.SearchText;" name="applySearchForm">
        <input type="text" value="" name="searchContent" autocomplete="off" placeholder="搜索">
    </form>
    <!-- var:url = ${options.name} === 'borrowInvoiceId' ? '/erp-management/borrow/list' : '/erp-management/application/list' -->
    <ul ui="type:mao.ui.AppListView;id:apply-cost-list-view;view:bill.applySelectList;initRefresh;reqUrl:${url}?applySearchForm&invoiceStatus=3;customEmpty:true;" class="bill-select-items flex-cont grey-bg">
        <!-- use:list-empty -->
    </ul>
</div>
<!-- 申请单选择列表项 -->
<!-- target:applySelectListItem -->
<li>
    <div ui="type:mao.ui.SelectRadio;item:&{item};value:${item.id};" class="apply-item bill-select-item white-bg radius-16">
        <div class="apply-title">${item.applyPersonName} 提交的 ${item.invoiceType|parseBaseInfo('finInvoiceType')}</div>
        <div class="apply-info">事由：${item.reasons|default}</div>
        <!-- var:amount = ${item.applyAmount} || ${item.borrowAmount} -->
        <div class="apply-info">金额：${amount}元</div>
        <!-- var:reasons = ${item.reasons} || ${item.remark} -->
        <div class="apply-info">备注：${reasons|default}</div>
        <div class="apply-tip">
            <span class="info-text">${item.ctime|dateFormat('yyyy-MM-dd')} 来自 审批</span>
        </div>
    </div>
</li>

<!-- 申请单选中项 -->
<!-- target:applySelectFormItem -->
<!-- var:item = ${item} || {} -->
<!-- var:href = ['', 'bill.purchase.detail', 'bill.cost.detail', 'bill.loan.detail', 'bill.reimbursement.detail', 'bill.corporatePayment.detail'][${item.invoiceType}] -->
<div class="apply-item apply-info-item" ui="type:control;item:&{item};ext-link;ext-stopPropagation" href="#/finance/${href}~id=${item.id}~DENY_CACHE">
    <div class="apply-info-title">${item.applyPersonName} 提交的 ${item.invoiceType|parseBaseInfo('finInvoiceType')}</div>
    <div class="apply-info-text">事由：${item.reasons|default}</div>
    <div class="apply-info-text">金额：${item.applyAmount}元</div>
    <div class="apply-info-text">备注：${item.remark|default}</div>
    <div class="apply-info-text">申请时间：${item.ctime|dateFormat('yyyy-MM-dd')}</div>

</div>
<!-- 借款单选中项 -->
<!-- target:borrowSelectFormItem -->
<!-- var:item = ${item} || {} -->
<!-- var:href = ['', 'bill.purchase.detail', 'bill.cost.detail', 'bill.loan.detail', 'bill.reimbursement.detail', 'bill.corporatePayment.detail'][${item.invoiceType}] -->
<div class="apply-item borrow-info-item" ui="type:control;item:&{item};ext-link" href="#/finance/${href}~id=${item.id}~DENY_CACHE">
    <div class="name">
        <span>${item.reasons|default}</span>
    </div>
    <div class="item-cont">
        <span class="day">${item.ctime|dateFormat('yyyy-MM-dd')} 来自 <span class="special-text">${item.applyPersonName}</span></span>
        <span class="fr">借款金额 <span class="special-text">￥${item.borrowAmount}</span></span>
    </div>
</div>

<!-- 费用申请 - 费用明细项 -->
<!-- target:cost-item -->
<div class="cost-item" ui="type:control;item:&{item}">
    <!-- if:!${isDetail} -->
    <input class="ui-hide" name="${name}" ui="type:ecui.esr.CreateObject" />
    <!-- for:${item} as ${_item},${_index} -->
    <input class="ui-hide" name="${name}.${_index}" value="${_item}"/>
    <!-- /for -->
    <!-- /if -->
    <div class="info-title">
        <span>费用明细={${i} + 1 ? ${i} + 1 : 0}</span>
        <!-- if:!${isDetail} -->
        <a class="fr" ui="type:NS.AddCostDetailBtn;ext-calculate-cost:${num};route:/finance/bill.cost.editCostDetail~fromEdit=true~DENY_CACHE;isCopy;text:复制;"></a>
        <a class="fr danger-text" ui="ext-deleteItem;id:${item.id};ext-calculate-cost:${num};item:&{item}">删除</a>
        <!-- /if -->
    </div>
    <div class="info-item">
        <div class="info-label">费用类型</div>
        <div class="info-text">${item.costType|parseBaseInfo('finCostType')}</div>
    </div>
    <div class="info-item">
        <div class="info-label">金额</div>
        <div class="info-text">￥${item.costAmount|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">备注</div>
        <div class="info-text">${item.remark|default}</div>
    </div>
</div>

<!-- 采购申请单 - 编辑费用 -->
<!-- target:editPurchaseCostItemPage -->
<form class="edit-container style-bill order-edit-container vertical-arrangement flex-page" name="editCostForm">

    <div class="flex-cont grey-bg" ui="type:m-panel">
        <div class="blank-24"></div>
        <div class="edit-item" ui="type:mao.ui.InputGroup;label:名称;required:true">
            <div ui="type:text;name:name;value:${options.item.name};" class="edit-text"></div>
        </div>
        <div class="edit-item" ui="type:mao.ui.InputGroup;label:规格;required:true">
            <div ui="type:text;name:size;value:${options.item.size};" class="edit-text"></div>
        </div>

        <div class="edit-item" ui="type:mao.ui.InputGroup;label:单位;required:true">
            <div ui="type:text;name:unit;value:${options.item.unit};" class="edit-text"></div>
        </div>

        <div class="edit-item" ui="type:mao.ui.InputGroup;label:单价;required:true">
            <div ui="type:NS.PurchasePriceNumber;name:unitPrice;value:${options.item.unitPrice};" class="edit-text"></div>
        </div>

        <div class="edit-item" ui="type:mao.ui.InputGroup;label:数量;required:true">
            <div ui="type:NS.PurchasePriceNumber;name:amount;value:${options.item.amount};" class="edit-text"></div>
        </div>

        <div class="edit-item" ui="type:mao.ui.InputGroup;label:金额;required:true">
            <div ui="type:number;name:sumPrice;value:${options.item.sumPrice};readOnly" class="edit-text"></div>
        </div>
        <div class="blank-24"></div>
    </div>

    <div class="ui-button ui-button-primary ui-button-full" ui="type:NS.EditCostConfirmBtn;">确定</div>
</form>

<!-- 采购申请单 - 编辑费用 -->
<!-- target:cost-purchase-item -->
<div class="cost-item" ui="type:control;item:&{item}">
    <!-- if:!${isDetail} -->
    <input class="ui-hide" name="${name}" ui="type:ecui.esr.CreateObject" />
    <!-- for:${item} as ${_item},${_index} -->
    <input class="ui-hide" name="${name}.${_index}" value="${_item}"/>
    <!-- /for -->
    <!-- /if -->
    <div class="info-title">
        <span>采购明细={${i} + 1 ? ${i} + 1 : 0}</span>
        <!-- if:!${isDetail} -->
        <a class="fr" ui="type:NS.EditCostBtn;title:新建费用;ext-calculate-cost:${num};view:bill.editPurchaseCostItemPage;name:purchaseInfoItemList;invoiceType:1;text:复制;item:&{item}"></a>
        <a class="fr danger-text" ui="ext-deleteItem;id:${item.id};ext-calculate-cost:${num};item:&{item}">删除</a>
        <!-- /if -->
    </div>
    <div class="info-item">
        <div class="info-label">名称</div>
        <div class="info-text">${item.name|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">规格</div>
        <div class="info-text">${item.size|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">单位</div>
        <div class="info-text">${item.unit|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">单价</div>
        <div class="info-text">${item.unitPrice|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">数量</div>
        <div class="info-text">${item.amount|default}</div>
    </div>
    <div class="info-item">
        <div class="info-label">金额</div>
        <div class="info-text">${item.sumPrice|default}</div>
    </div>

</div>

<!-- 账户选择页面 -->
<!-- target:accountSingleSelect -->
<!-- // 单择 模板 -->
<div class="select-container flex-page account-select-page">
    <div class="page-title"><span>我的卡</span> <span class="tip"> (共${items.length}张)</span> <span class="add-btn" ui="type:NS.ToAccountBtn" href="/finance/account.edit~relationId=${options.accountUnit}~formEdit=true~DENY_CACHE">添加收款账户</span></div>
    <div class="select-cont flex-cont grey-bg" ui="type:m-panel">
        <div class="select-items bill-select-items grey-bg">
            <!-- for: ${items} as ${item} -->
            <div ui="type:mao.ui.SelectRadio;name:SelectRadio;item:&{item};value:${item.id};text:${item.accountName};={ ${value} == ${item.id} ? 'checked' : ''}" class="account-select-item bill-select-item white-bg account-${item.accountType}">
                <div class="type">${item.accountType|parseBaseInfo('finAccountType')}</div>
                <div class="account-info title">
                    <!-- if:${item.accountType} === 1 -->
                    <span class="text">${item.bankName} ${item.subBankName}</span>
                    <!-- else -->
                    <span class="text">${item.accountType|parseBaseInfo('finAccountType')}</span>
                    <!-- /if -->
                </div>
                <div class="account-info"><span class="label">户名：</span><span class="text">${item.accountName}</span></div>
                <div class="account-info"><span class="label">账号：</span><span class="text">${item.accountCode}</span></div>
                <div class="type-icon type-${item.accountType}"></div>
            </div>
            <!-- /for -->
        </div>
    </div>
</div>


<!-- 账户选择项 - 账户选择页面 -->
<!-- target:accountSingleSelectItem -->
<div class="account-select-item detail-item grey-bg ={${selected} ? 'selected' : ''} account-${item.accountType}">
    <div class="type">${item.accountType|parseBaseInfo('finAccountType')}</div>
    <div class="account-info title">
        <!-- if:${item.accountType} === 1 -->
        <span class="text">${item.bankName} ${item.subBankName}</span>
        <!-- else -->
        <span class="text">${item.accountType|parseBaseInfo('finAccountType')}</span>
        <!-- /if -->
    </div>
    <div class="account-info"><span class="label">户名：</span><span class="text">${item.accountName}</span></div>
    <div class="account-info"><span class="label">账号：</span><span class="text">${item.accountCode}</span></div>
</div>


<!-- target:accountPopEdit -->
<form class="flex-cont grey-bg vertical-arrangement" name="accountPopForm" ui="type:m-panel">
    <!-- if:${id} -->
    <input name="id" ui="type:text" class="ui-hide" value="${detail.id}">
    <!-- /if -->
    <input class="ui-hide" name="invoiceType" value="5"/>

    <div class="blank-24"></div>

    <div class="edit-item" ui="type:mao.ui.InputGroup;label:银行账户;required:true">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="reasons" value="${detail.reasons}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:户名;required:true">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="reasons" value="${detail.reasons}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:账号;required:true">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="reasons" value="${detail.reasons}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:开户银行;required:true">
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;title:开户银行;items:&{mao.info.baseInfo.subjectList};name:affiliateCompanyId;value:${detail.affiliateCompanyId};text:${detail.affiliateCompanyName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:开户省市;required:true">
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;title:开户省市;items:&{mao.info.baseInfo.subjectList};name:affiliateCompanyId;value:${detail.affiliateCompanyId};text:${detail.affiliateCompanyName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:分支行;required:true">
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;view:dept_select;title:分支行;name:affiliateDepartmentId;value:${detail.affiliateDepartmentId};text:${detail.affiliateDepartmentName};"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="blank-24"></div>
</form>




<!-- target:billComment -->
<!-- var:auditState = ${detail.auditState} !== undefined ? ${detail.auditState} : ${contractInfo.auditState}; -->
<form class="operate-btn-box" ui="ext-ios-fixed:bottom" name="billCommentForm">
    <input class="ui-hide" ui="type:text" name="id" value="${detail.id}" />
    <input class="ui-hide" ui="type:text" name="invoiceCode" value="${detail.invoiceCode}" />
    <input class="ui-hide" ui="type:text" name="invoiceType" value="${detail.invoiceType}" />
    <input class="ui-hide" ui="type:text" name="action" value="" />
    <label ui="type:NS.BillCommentSave;name:comment;">
        <input class="text" type="text" placeholder="请输入" name="comment" />
        <input class="submit-btn" type="button" disabled value="提交"/>
        <div class="btn-items">
            <strong type="text" class="btn-item comment-item" ui="module:${module};action:7">
                <span class="icon"></span>
                <span>评论</span>
            </strong>
        </div>
    </label>

	<!-- if:${detail.approval.isInitiator} -->
		<!-- if:${detail.approval.isWithdraw} -->
		<!-- <a ui="type:mao.ui.ApprovalSubmitBtn;tip:成功撤销;cType:0;bType:6;cName:${detail.reasons|options}" href="javascript: void(0);"  class="opt-btn ui-button leave-btn" >撤销</a> -->
		<!-- /if -->
		<!-- if:mao.util.hasSubmitAgain(${detail.invoiceStatus}) -->
        <!-- var:routeName = ['', '/finance/bill.purchase.edit', '/finance/bill.cost.edit', '/finance/bill.loan.edit', '/finance/bill.reimbursement.edit', '/finance/bill.corporatePayment.edit'][${detail.invoiceType}] -->
        <div class="btn-items">
            <div ui="ext-replace-link" class="btn-item" href="#${routeName}~id=${detail.id}~DENY_CACHE">
                <span class="icon again"></span>
                <span>再次提交</span>
            </div>
        </div>
		<!-- /if -->
	<!-- /if -->
    <div class="operate-btns">
        <!-- if:${detail.approval.isCurrentApprover} -->
            <!-- if:${detail.invoiceStatus} === 1 -->
            <strong class="operate-btn refuse-btn" ui="type:mao.ui.ApprovalSubmitBtn;bType:6;cType:2;tip:审批已拒绝">拒绝</strong>
            <strong class="operate-btn agree-btn" ui="type:mao.ui.ApprovalSubmitBtn;bType:6;cType:3;tip:审批已同意">同意</strong>
            <!-- /if -->
        <!-- /if -->
    </div>
</form>